subroutine r2abij_t2efij_iefab2(r2, t2, &
              iabcd, icore, fact)
!
use mod_size
use mod_iop
use mod_orbit
use mod_ioff 
use mod_symm
implicit none
!
real*8, intent(in) :: fact
real*4, intent(in) :: iabcd(*)
real*4, intent(in) :: r2(*)
!
real*4, intent(inout) :: t2(*), icore(*)
!
integer :: i, j, a, b, nsize, i0, i1, i2, i3, i4, i5, i6, i7
integer :: c, d, iin1, iin2, iout1, iout2, iout3, iout4
integer, external :: idsymsoc
character*8 file1, file2
real*8, external :: nrm2so
!this is to do r2 = r2 + 0.5*t2(efij)*iefab
if(prec==8) then 
   file1 = 'ABCDAB1_'
   file2 = 'ABCDAB2_'
elseif(prec==4) then  
   file1 = 'ABCDAB1S'
   file2 = 'ABCDAB2S'
endif   
i0 = 1                  ! t+
i1 = i0 + nvvoo*isd     ! t-
i2 = i1 + nvvoo*isd     ! tmp+
i3 = i2 + nvvoo*isd     ! tmp-
i4 = i3 + nvvoo*isd     ! icore 
! t-
call iassymso(t2, icore(i1), 1, vrta, vrta, popa, popa, 1)
call icompso(icore(i1), icore(i0), vrta, vrta, 1, 0, popa, popa, 0, 1, 1)
!nsize = idsymsoc(1, vrta, vrta, 0, popa, popa, 0)
!write(6,*)'norm of t-', nrm2so(nsize, icore(i0), 1)
! t+
call isymtrso(t2, icore(i1), vrta, vrta, 1, 1, popa, popa, 1, 0, 1)
nsize = idsymsoc(1, vrta, vrta, 1, popa, popa, 1)
call axpyso(nsize, 1.d0, t2, 1, icore(i1), 1)
call icompso(icore(i1), icore(i2), vrta, vrta, 1, 2, popa, popa, 1, 1, 1)
call icompso(icore(i2), icore(i1), vrta, vrta, 2, 1, popa, popa, 1, 2, 1)
!nsize = idsymsoc(1, vrta, vrta, 2, popa, popa, 2)
!write(6,*)'norm of t+', nrm2so(nsize, icore(i1), 1)

!--------  t-*abcd-
call VpqmnVmnrs_to_Vpqrs(iabcd(ioi6(1)), icore(i0), 1, 1, vrta, vrta, 0, &
                 vrta, vrta, 0, popa, popa, 0, icore(i2), 1, 0.5d0, 0.d0)
!nsize = idsymsoc(1, vrta, vrta, 0, popa, popa, 0)
!write(6,*)'norm of tmp abcd 1', nrm2so(nsize, icore(i2), 1)

!--------  t+*abcd+
call VpqmnVmnrs_to_Vpqrs(iabcd(ioi6(2)), icore(i1), 1, 1, vrta, vrta, 2, &
                 vrta, vrta, 2, popa, popa, 2, icore(i3), 1, 0.5d0, 0.d0)
!nsize = idsymsoc(1, vrta, vrta, 2, popa, popa, 2)
!write(6,*)'norm of tmp abcd 2', nrm2so(nsize, icore(i3), 1)

!-------expand r-  to icore(i0)
call iexpso(icore(i2), icore(i1), vrta, vrta, 0, 1, popa, popa, 0, 0, 1)
call iexpso(icore(i1), icore(i0), vrta, vrta, 1, 0, popa, popa, 0, 1, 1)
! nsize = idsymsoc(1, vrta, vrta, 1, popa, popa, 1)
! write(6,*)'norm of test abcd 1', nrm2so(nsize, icore(i0), 1)

!-------expand r+  to icore(i1)                                       
call iexpso(icore(i3), icore(i2), vrta, vrta, 2, 0, popa, popa, 2, 1, 1)
call iexpso(icore(i2), icore(i1), vrta, vrta, 2, 1, popa, popa, 1, 0, 1)
!nsize = idsymsoc(1, vrta, vrta, 1, popa, popa, 1)
!write(6,*)'norm of test abcd 2', nrm2so(nsize, icore(i1), 1)
! t- + t+
nsize = idsymsoc(1, vrta, vrta, 1, popa, popa, 1)
call axpyso(nsize, 1.d0, icore(i1), 1, icore(i0), 1)
!nsize = idsymsoc(1, vrta, vrta, 1, popa, popa, 1)
!write(6,*)'norm of test abcd', nrm2so(nsize, icore(i0), 1)
!
call axpyso(nioi32, fact*2.d0, icore(i0), 1, r2(ioi3(2)), 1)
return
end
